<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>嘉怡快乐铺满网页</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Arial Rounded MT Bold", "Microsoft YaHei", sans-serif;
        }
        /* 全屏渐变背景，营造温暖快乐基调 */
        body {
            min-height: 100vh;
            background: linear-gradient(120deg, #ffecd2, #fcb69f, #ffecd2);
            background-size: 200% 200%;
            animation: bgFlow 15s ease infinite;
            overflow-x: hidden;
        }
        /* 背景流动动画 */
        @keyframes bgFlow {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        /* 主标题样式，居中突出 */
        .main-title {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 6vw;
            font-weight: 900;
            color: #ff4e50;
            text-shadow: 0 0 15px rgba(255, 78, 80, 0.5), 0 0 30px rgba(255, 236, 210, 0.8);
            z-index: 10;
            transition: all 0.3s ease;
        }
        .main-title:hover {
            transform: translate(-50%, -50%) scale(1.1);
            text-shadow: 0 0 20px rgba(255, 78, 80, 0.7), 0 0 40px rgba(255, 236, 210, 1);
        }
        /* 分散的快乐元素，铺满整个页面 */
        .happy-item {
            position: absolute;
            font-size: clamp(1rem, 3vw, 2rem);
            color: #ff7a7a;
            opacity: 0.7;
            text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
            animation: float 8s ease-in-out infinite;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .happy-item:hover {
            opacity: 1;
            transform: scale(1.2);
            color: #ff4e50;
            text-shadow: 0 0 12px rgba(255, 78, 80, 0.6);
        }
        /* 不同元素不同浮动轨迹 */
        .happy-item:nth-child(odd) {
            animation-duration: 6s;
        }
        .happy-item:nth-child(3n) {
            color: #ffb6c1;
            animation-duration: 10s;
        }
        .happy-item:nth-child(4n) {
            color: #ff9a8b;
            animation-duration: 7s;
        }
        /* 浮动动画 */
        @keyframes float {
            0% { transform: translateY(0) rotate(0deg); }
            50% { transform: translateY(-20px) rotate(5deg); }
            100% { transform: translateY(0) rotate(0deg); }
        }
    </style>
</head>
<body>
    <!-- 中心主标题 -->
    <h1 class="main-title">嘉怡快乐</h1>

    <!-- 动态生成铺满页面的快乐元素 -->
    <script>
        // 定义要展示的快乐相关文本
        const happyTexts = [
            "嘉怡快乐", "天天开心", "笑容灿烂", "好运连连",
            "嘉怡超快乐", "心情满分", "快乐无限", "元气满满",
            "嘉怡的快乐", "喜乐常伴", "开心每一天", "快乐翻倍"
        ];
        // 生成元素数量（根据屏幕大小动态调整）
        const itemCount = Math.floor(window.innerWidth * window.innerHeight / 15000);
        
        // 循环生成元素并随机分布
        for (let i = 0; i < itemCount; i++) {
            const item = document.createElement("div");
            item.className = "happy-item";
            // 随机选择文本
            item.textContent = happyTexts[Math.floor(Math.random() * happyTexts.length)];
            // 随机定位在页面任何位置
            item.style.left = `${Math.random() * 100}%`;
            item.style.top = `${Math.random() * 100}%`;
            // 随机延迟动画，避免同步
            item.style.animationDelay = `${Math.random() * 5}s`;
            document.body.appendChild(item);
        }

        // 窗口大小改变时重新生成元素（适配响应式）
        window.addEventListener("resize", () => {
            const oldItems = document.querySelectorAll(".happy-item");
            oldItems.forEach(item => item.remove());
            const newCount = Math.floor(window.innerWidth * window.innerHeight / 15000);
            for (let i = 0; i < newCount; i++) {
                const item = document.createElement("div");
                item.className = "happy-item";
                item.textContent = happyTexts[Math.floor(Math.random() * happyTexts.length)];
                item.style.left = `${Math.random() * 100}%`;
                item.style.top = `${Math.random() * 100}%`;
                item.style.animationDelay = `${Math.random() * 5}s`;
                document.body.appendChild(item);
            }
        });
    </script>
</body>
</html>
